﻿<%@ WebHandler Language="C#" Class="GetCalTypeUser" %>

using System;
using System.Text;
using System.Data;
using System.Web;
using BLL;
public class GetCalTypeUser : IHttpHandler {
    
    public void ProcessRequest (HttpContext context) {
        context.Response.ContentType = "text/plain";
        string id;
        id = context.Request.Params["id"].ToString().Trim();
        DataTable dt = new PayModelService().GetUserCalType(id);
        StringBuilder sb = new StringBuilder();
        sb.Append("{");
        for (int i = 0; i < dt.Rows.Count; i++)
        {
            sb.Append(",\"" + dt.Rows[i]["Name"].ToString() + "\":\"" + dt.Rows[i]["cid"].ToString() + "\"");
        }

        sb.Append("}");
        context.Response.Write(sb.Replace("{,", "{"));
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }

}